import { ADD, SUBTR } from './actionTypes';

export default (state = { count: 0 }, action) => {
    console.error(action);
    switch(action.type) {
        case ADD: {
            return { ...state, count: state.count + action.num };
        }
        case SUBTR: {
            return state - action.num;
        }
        default: {
            return state;
        }
    }
}